// 最好不要动

import {configureStore} from '@reduxjs/toolkit'

import record from './chen/record'
import cart from './modoles/cart'
import setting from './modoles/setting'

import {persistStore,persistReducer} from 'redux-persist'
import storage from 'redux-persist/lib/storage'

let recordPersis ={
    key:'recordss',
    storage
}

let cartPersis ={
    key:'cartss',
    storage,
}

let settingsPersis={
    key:'settingss',
    storage,
}

let recordPerF=persistReducer(recordPersis,record)
let cartPerF=persistReducer(cartPersis,cart)
let settingPerF=persistReducer(settingsPersis,setting)

export let store = configureStore({
    reducer: {
        record:recordPerF,
        cart:cartPerF,
        setting:settingPerF
    },
    middleware:(getDefaultMiddleware)=>
    getDefaultMiddleware({
        serializableCheck:false
    })
})

export let persistor = persistStore(store)